package com.andy.springboot.dto;

import java.util.Collections;
import java.util.List;

import com.andy.springboot.ao.PageCondition;

/**
 * 分页容器
 * @author Andy.ye
 * @date 2018年3月23日 下午3:28:45
 */
public class PageContainer<T> {

	private int totalCount;

	/**
	 * 总页数
	 */
	private int pageCount;

	private List<T> dataList = Collections.emptyList();

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		double count = (double) totalCount / PageCondition.pageSize;
		this.pageCount = (int) Math.ceil(count);
		this.totalCount = totalCount;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public List<T> getDataList() {
		return dataList;
	}

	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}
}
